<template>
	<view class="row" @click="handleClick">
		<text class="label">{{ label }}</text>
		<view class="value picker-btn">
			{{ selectedText || placeholder }}
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			label: {
				type: String,
				required: true
			},
			selectedText: {
				type: String,
				default: ''
			},
			placeholder: {
				type: String,
				default: '请选择'
			},
		},
		methods: {
			handleClick() {
				this.$emit('click'); // 点击事件
			},
		},
	};
</script>

<style scoped>
	.row {
		display: flex;
		align-items: center;
		margin-bottom: 15px;
	}

	.label {
		width: 100px;
		font-size: 16px;
		color: #333;
	}

	.value {
		flex: 1;
		font-size: 16px;
		padding: 10px;
		background: #f9f9f9;
		border: 1px solid #ddd;
		border-radius: 5px;
	}

	.picker-btn {
		color: #007aff;
		cursor: pointer;
	}
</style>